﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using EntityFrameWorkTest.Models;

namespace EntityFrameWorkTest.Models.Mapping
{
    class DiverMap : EntityTypeConfiguration<Diver>
    {
        public DiverMap()
        {
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.name)
                .HasMaxLength(100);

            // this.Property(t => t.jump);

            this.ToTable("Diver");
            this.Property(t => t.id).HasColumnName("Id");
            this.Property(t => t.name).HasColumnName("Name");
        }
    }
}
